/* var name = 10;
var obj = {
  name: '珠峰培训'
};
console.log(obj.name);
console.log(obj['name']);
// obj[name变量代表的值] obj[10]
console.log(obj[name]); */

var obj = {
  name: '张三',
  age: 18,
  friends: '李四, 王五',
  1: 20,
  2: 149,
  3: 140
};

for(let key in obj) {
  // 每一次循环key变量存储的值: 当前对象的属性名
  console.log(key);
  console.log(obj[key]);
}
